<?php

namespace Lib;


use EasySwoole\Component\Di;
use Medoo\Medoo;

class DB
{
    public static function init($dbName = 'pet'): Medoo
    {
//        return Di::getInstance()->get('mysql_' . $dbName);
        return $db = new Medoo([
            'database_type' => 'mysql',
            'database_name' => config('db.pet.db'),
            'server' => config('db.pet.host'),
            'username' => config('db.pet.user'),
            'password' => config('db.pet.pwd'),
            'charset' => 'utf8'
        ]);
    }
}
